package cn.edu.hznu.coursework.entity;

import java.util.List;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table
@DynamicUpdate(true)
public class Teacher extends AbstractUser {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2304447119115405834L;

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher", orphanRemoval = true)
	private List<Course> courses;
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "teacher", orphanRemoval = true)
	private List<TeacherWork> teacherWorks;

	public List<Course> getCourses() {
		return courses;
	}

	public void setCourses(List<Course> courses) {
		this.courses = courses;
	}

	public List<TeacherWork> getTeacherWorks() {
		return teacherWorks;
	}

	public void setTeacherWorks(List<TeacherWork> teacherWorks) {
		this.teacherWorks = teacherWorks;
	}
	
}
